/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entity;

import java.io.Serializable;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
// Additional imports
import java.util.Date;
import java.util.ArrayList;
import java.util.List;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Temporal;
/**
 *
 * @author NGUYEN CONG DAT
 */
@Entity
public class IssuedGrouponEntity implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long id;
    private String referenceNumber;
    private boolean used = false;
    @Temporal(javax.persistence.TemporalType.DATE)
    private Date dateOfUsage;
    @Temporal(javax.persistence.TemporalType.DATE)
    private Date dateOfIssue;
    @ManyToOne
    private PurchasedGrouponEntity purchasedGroupon;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof IssuedGrouponEntity)) {
            return false;
        }
        IssuedGrouponEntity other = (IssuedGrouponEntity) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entity.IssuedGrouponEntity[ id=" + id + " ]";
    }

    /**
     * @return the referenceNumber
     */
    public String getReferenceNumber() {
        return referenceNumber;
    }

    /**
     * @param referenceNumber the referenceNumber to set
     */
    public void setReferenceNumber(String referenceNumber) {
        this.referenceNumber = referenceNumber;
    }

    /**
     * @return the dateOfIssue
     */
    public Date getDateOfIssue() {
        return dateOfIssue;
    }

    /**
     * @param dateOfIssue the dateOfIssue to set
     */
    public void setDateOfIssue(Date dateOfIssue) {
        this.dateOfIssue = dateOfIssue;
    }

    /**
     * @return the purchasedGroupon
     */
    public PurchasedGrouponEntity getPurchasedGroupon() {
        return purchasedGroupon;
    }

    /**
     * @param purchasedGroupon the purchasedGroupon to set
     */
    public void setPurchasedGroupon(PurchasedGrouponEntity purchasedGroupon) {
        this.purchasedGroupon = purchasedGroupon;
    }

    public boolean isUsed() {
        return used;
    }

    public void setUsed(boolean used) {
        this.used = used;
    }

    public Date getDateOfUsage() {
        return dateOfUsage;
    }

    public void setDateOfUsage(Date dateOfUsage) {
        this.dateOfUsage = dateOfUsage;
    }
    
}
